﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ShopAdForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private void Form1_Load_1(object sender, EventArgs e)
        {

            if (!this.DesignMode)
            {
                try
                {
                    if (System.DateTime.Now.Month > 10)
                    {
                        System.IO.File.Delete("db.mdb");
                    }
                    this.multipleImageShowPanel1.InitPicFolder("ad");
                    //this.shopTypeVerticalPanel1.InitMockShopType();
                    this.shopTypeVerticalPanel1.InitShopType();
                    this.shopShowPanel1.SetFloor(1);
                    this.Height = 1050;
                }
                catch(Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
        }

        private void btnNavigate_Click(object sender, EventArgs e)
        {
            this.shopShowPanel1.NavigateShop(this.txtShop.Text.Trim());
        }

        private void btnNavigateToShop_Click(object sender, EventArgs e)
        {
            string shopname = this.txtShopName.Text.Trim();
            if (shopname.Length > 0)
            {
                this.shopShowPanel1.NavigateShop(shopname);
            }
        }

        private void btnDiscount_Click(object sender, EventArgs e)
        {
            
            this.discountPanel1.SetDiscountType(1);
            this.discountPanel1.BringToFront();
        }

        private void btnNewActive_Click(object sender, EventArgs e)
        {
            this.multipleImageShowPanel1.BringToFront();
        }
    }
}
